home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp95 / freyja13.exe / lha / FREYJA.DOC < prev    next >
Text File  |  1992-03-22  |  19KB  |  508 lines

  1.             The Freyja Text Editor
  2.  
  3.            (Freyja Reduksjon Emacs, Ytre Jevn All)
  4.          (Freyja Reduces Emacs Yet Joins All)
  5.     (Norse goddess of sunshine, death, fertility, and divination)
  6.  
  7.          Copyright 1991,2 by Craig A. Finseth
  8.  
  9.  
  10. Freyja is a text editor that implements the Emacs command set.  It is
  11. not interactively extensible: to make changes, you must edit the
  12. source code and recompile.
  13.  
  14. Freyja implements this author's favorite variation on the Emacs command
  15. set.  As such, it is somewhat idisyncratic.  However, if you don't
  16. like something about it, you are welcome to change it.
  17.  
  18. While Freyja runs on UNIX systems, it was designed with MS/DOS systems
  19. in mind.  In particular, it was designed to run on RAM-based laptop
  20. and palmtop computers.
  21.  
  22. The Freyja documentation (including this file) is rather sketchy.  It
  23. assumes that you know (1) what Emacs editors are all about (or at
  24. least what text editors are all about) and (2) you aren't intimiated
  25. by installing a C program (and figuring things out from source code). 
  26. (Well, MS/DOS users have it easy as executables are included.)
  27. Books on emacs are listed with the Emacs implementations in the file
  28. "emacs".
  29.  
  30. If you are intrigued by Emacs text editors, a list of other
  31. implementations can be found in the "emacs" file included with this
  32. distribution.  If you want to know more about how text editors work, I
  33. will refer you to my book "The Craft of Text Editing"
  34. (Springer-Verlag, 1991, ISBN 0-387-97616-7 or 3-540-97616-7).
  35.  
  36. The rest of this file and the "ftutoria.doc" file provide a basic
  37. introduction to the Freyja editor and its commands.  In addition, the
  38. files "fcmdlist.doc" and "fcmdxref.doc" provide a detailed command
  39. list and command cross-reference chart.
  40.  
  41.  
  42.  
  43. EDITING MODEL
  44.  
  45. Freyja edits text in units of "buffers," where a buffer is a
  46. one-dimensional array of bytes (characters).  Typically, a buffer is a
  47. copy of a file being edited.
  48.  
  49. All editing operations are performed within (or between) buffers. Each
  50. buffer has a "point."  The point is the location where all editing
  51. changes take place.  The point is always between two characters.
  52. Typically, the left edge of your display's cursor will be at the
  53. point.
  54.  
  55. In addition, each buffer has a "mark."  This is a designated location
  56. that is remembered for you.  You can move the point there (the ^X ^X
  57. command) or move it to the point (the ^@ or ^[ SP commands).  (Also,
  58. the ^Y, ^[ <, and ^[ > commands set the mark for you.)  The range of
  59. characters between the point and the mark is called the "region" (it
  60. doesn't matter which of the point and the mark is earlier in the
  61. buffer).  Many commands operate over all text in the region.  For
  62. example, you can delete ("cut") or copy this text.  You can also
  63. convert it to uppercase, lowercase, indent it, outdent it, and so
  64. forth.
  65.  
  66. Most deletion commands copy the deleted text to the "kill buffer."
  67. This text can be retrieved with the ^Y command.  (The commands that do
  68. not copy the text are ^D, ^H, ^? (UNIX), the whitespace-munging
  69. commands, and the ^W command if given an argument.)  Successive
  70. deletions accumulate text in the delete buffer. Hence, "^[ D ^[ D ^[
  71. D" has the same effect as ^U 3 ^[ D".  Any non-accumulating deletion
  72. command turns off the accumulation (it can be turned back on with the
  73. ^[ ^W command).  A "+" character appears in the mode line if
  74. accumulating is on (i.e., the next deletion command will accumulate,
  75. not replace, the kill buffer contents).
  76.  
  77.  
  78.  
  79. COMMAND TYPES
  80.  
  81. There are three types of commands:
  82.  
  83. - Regular commands are control characters.  They are written as ^#,
  84. where "#" is some character.
  85.  
  86. - Control-X commands are typed by typing the ^X regular command, then
  87. another character.  They are written as "^X #", where "#" can be any
  88. character including control characters.  The upper/lower case of # is
  89. ignored.
  90.  
  91. - Meta commands are typed by typing the ^[ regular command (use the
  92. ESC or Escape key, if available), then another character.  They are
  93. written as "^[ #", where "#" can be any character including control
  94. characters.  The upper/lower case of # is ignored.
  95.  
  96.  
  97.  
  98. PARAMETERS
  99.  
  100. - You can give numeric arguments to commands by starting with the
  101. universal argument (^U) regular command.  There are two forms:
  102.  
  103.     ^U ^U .... <cmd>    does <cmd> 4, 16, 64, 256, ... times
  104.                 depending upon the number of ^Us (each
  105.                 ^U is a multiplier by 4)
  106.     ^U <integer> <cmd>    does <cmd> <integer> times
  107.  
  108. <cmd> can be any command.  Where it makes sense to do so, the argument
  109. is used as a repeat count.
  110.  
  111. - Some commands prompt for string arguments.  If there is a default
  112. value, it will be shown and can be selected by just typing ^M
  113. (Return).  Otherwise, you can type your response.  Editing commands are:
  114.  
  115.     ^H, ^?    erase the last character
  116.     ^G, ^[    cancel the command
  117.     ^Y    yank the kill buffer into the prompt (be sure that the
  118.         kill buffer text isn't too large, or you will have to
  119.         listen to the bell for a while)
  120.  
  121. - Some commands prompt for single-character arguments.  They can be
  122. cancelled with ^G or ^[.
  123.  
  124.  
  125.  
  126. HELP
  127.  
  128. The ^X H command gets you into the help subsystem.  This system allows
  129. you to get help in many areas.  It include the "apropos" facility
  130. which is a tradition among Emacs-type text editors.
  131.  
  132. This "apropos" command asks you for a word and lists those commands
  133. that include that word in their descriptions.  For example, if you
  134. entered "lines", it would list the commands that operate on lines.
  135.  
  136. You should keep the following synonyms in mind when using apropos:
  137.  
  138.     following | forward | next
  139.     backward | preceding  | previous
  140.     delete  | erase  | kill
  141.     mark | region
  142.  
  143.  
  144.  
  145. DISPLAY
  146.  
  147. Most characters are displayed as themselves.  Three characters are
  148. displayed specially:
  149.  
  150. - Tab characters (^I, 9 decimal) move the cursor to the next tab stop.
  151. Tab stops are set every N characters, where N can be different for
  152. each buffer.
  153.  
  154. - "Hard" newlines (^J, 10 decimal) move the cursor to the start of the
  155. next line.
  156.  
  157. - "Soft" newlines (^_, 31 decimal) also move the cursor to the start
  158. of the next line.  The difference between hard and soft newlines is
  159. explained later.
  160.  
  161. An initialization parameter ("VISible grayspace," see the file
  162. "freyja.ini") and command (^X `) control whether these characters and
  163. spaces are "visible."  Try it and see.
  164.  
  165. Other control and meta characters (those with values < 31 decimal and
  166. >= 127 decimal) are either displayed in "caret" notation or as
  167. themselves (controlled with the "USE caret notation" initialization
  168. parameter).
  169.  
  170. Freyja supports two separate windows.  You create two windows by
  171. giving the ^X 2 or ^X 3 command (they only differ in which window the    
  172. cursor is left in). While these windows initially display the same
  173. text, you can move each independantly of the other.  You can switch
  174. windows by giving the ^X O command.  You can grow the current window
  175. by giving the ^X ^ command. (No window can be less than 3 lines
  176. high.)  You can return to one window by giving the ^X 1 command.
  177.  
  178. Each window can be separately scrolled vertically or horizontally.
  179. (Long lines do not wrap.)  Use the ^X < and ^X > commands to scroll
  180. the window.  Note that the window will always be moved to show the
  181. point.
  182.  
  183.  
  184.  
  185. THE STATUS LINE
  186.  
  187. The last line on the screen is called the status line.  It shows the
  188. name and version number of the editor, the name of the file currently 
  189. being edited, the percentage of the buffer that the point is at, and
  190. two other indicators:
  191.  
  192. - A "*" is displayed if the buffer has been modified since it was
  193. last read from or written to the associated file.
  194.  
  195. - A "+" is displayed if the next deletion command will add to instead
  196. of replacing the contents of the kill buffer.
  197.  
  198.  
  199.  
  200. FILE AND BUFFER COMMANDS
  201.  
  202. Freyja allows you to edit or view up to 11 files at once.  Freyja
  203. commands work on a copy of the file, not the file itself.  Each of
  204. these copies is called a buffer.  There are a number of commands that
  205. transfer the text between the buffer and the file.
  206.  
  207. The ^X ^F (find file) command asks for the name of a file.  If the
  208. file is already present in a buffer, it switches to that buffer.  If
  209. not, it creates a new buffer and reads the file in.  You can create a
  210. new file by doing a ^X ^F and giving the name of the new (presumably
  211. non-existant) file.
  212.  
  213. The ^X ^R (read file) command asks for the name of a file and reads
  214. it on top of the file in the current buffer.  It is most often used
  215. for refreshing a modified buffer from the file itself.
  216.  
  217. The ^X ^S (save file) command save the contents of the buffer in the
  218. file.
  219.  
  220. The ^X ^W (write file) command asks for the name of a file and saves
  221. the buffer to that file.
  222.  
  223. You can also move among the buffers.  These buffers are arranged in a
  224. ring, and you can give the commands:
  225.  
  226.     ^X B    move to the next buffer in the ring
  227.     ^X V    move to the previous buffer in the ring
  228.     ^X K    delete the current buffer and move to the previous
  229.         buffer in the ring
  230.  
  231.  
  232.  
  233. SEARCHING
  234.  
  235. When searching, you are prompted for the entire string and that string
  236. is then searched for as a unit.  If the search is not successful, the
  237. point does not move.  A lower-case character in the search string will
  238. match either a lower- or upper-case character in the buffer.  An
  239. upper-case character in the search string will only match an
  240. upper-case charecter in the buffer.  Thus, a search string of "the"
  241. matches "the" or "The", but a search string of "ROM" does not match
  242. "from".
  243.  
  244.  
  245.  
  246. REPLACE AND QUERY REPLACE
  247.  
  248. The ^[ R (replace) and ^[ ^R (query replace) commands let you
  249. substitute one string for another.  The commands ask for an old
  250. string and a new one.  They search for each occurrance of the old
  251. string in the same manner as ^S starting with the point and
  252. proceeding to the end of the buffer.  The replace command simply
  253. replaces the old string with the new.  The query replace command asks
  254. you at each occurrance.  You can type:
  255.  
  256.     Y,y,space    do the replace and continue
  257.     N,n,^H,^?    DON'T do the replace and continue
  258.     ,        do the replace, show the results, and ask for
  259.             Y/N confirmation
  260.     .        do the replace and don't continue
  261.     !        do the replace and all rest without asking
  262.             (i.e. turn into a replace command)
  263.     ^G,^[        exit immediately
  264.  
  265.  
  266.  
  267. WORD WRAP (SOFT vs. HARD NEWLINES)
  268.  
  269. Frey supports three types of filling / wrapping.
  270.  
  271. The first type is "none:" no wrapping is done automatically.
  272. Paragraphs can be refilled with the ^[ Q command.
  273.  
  274. The second type is "hard:" filling is done as input is typed.
  275. However, only the current line is filled.  Paragraphs can be refilled
  276. with the ^[ Q command.  Hard newlines are used.  Thus, when the file
  277. is written to disk, an actual newline (^J or ^M/^J) will be in the
  278. file.  Paragraphs are in general separated by two consecutive
  279. newlines.  Freyja's paragraph commands will in addition treat newline
  280. / space, newline / Tab, newline / ".", and newline / "@" as paragraph
  281. breaks.
  282.  
  283. The third type is "wrap:" the current paragraph is refilled as input
  284. is typed.  Paragraphs can be refilled with the ^[ Q command.  Lines
  285. within paragraphs are separated by soft newlines (^_, 31 decimal).  A
  286. hard newline ends a paragraph.
  287.  
  288. Regions can be converted between hard and soft newlines with the ^X {
  289. and ^X } commands.
  290.  
  291. You can control the word wrap mode on a buffer with the ^X / command.
  292.  
  293. If the initialization parameter "WRAp allowed" is "yes," each file
  294. will be checked for a "ruler line" as it is being read in.  If the
  295. ruler line is present, it is used to set the per-buffer settings
  296. (margins, tab spacing, and wrap mode).
  297.  
  298. The ruler line is compatible with that used by Borland's Sprint(tm)
  299. package and has the following format:
  300.  
  301.     ^KR #,T #,L #?
  302.  
  303. where:
  304.  
  305.     ^K is the vertical tab control character, 11 decimal
  306.     R # sets the right margin to column #
  307.     T # sets the tab spacing to # columns
  308.     L # sets the left margin to column #
  309.     ?, if present, sets the wrap mode (if not present, word wrap
  310.         is assumed).  ? can be:
  311.  
  312.         ,N    none
  313.         ,F    hard fill
  314.         ,W    word wrap
  315.  
  316. The ruler line must be on a line by itself (no leading or trailing
  317. text) and must be the first line in the file that is neither blank nor
  318. starts with a "." or "@" character.  A single, leading, blank line, if
  319. present, is skipped.  Thus, if your file starts with, say:
  320.  
  321.     <blank>
  322.     @PageFooting()
  323.     <ruler>
  324.  
  325. The ruler line will be found.
  326.  
  327.  
  328.  
  329. SYSTEM BUFFERS
  330.  
  331. A buffer whose name starts with a percent sign ("%") is a "system
  332. buffer."  These buffers are created, overwritten, and otherwise
  333. manipulated by Freyja without notice.  They are otherwise ordinary
  334. buffers.
  335.  
  336. The buffer commands (^X ^B, ^X B, ^X K, ^X V) ordinarily skip these
  337. buffers.  You can cause the commands to not skip these buffers by
  338. supplying an argument to the command.
  339.  
  340. When you exit Freyja, the modification flags of system buffers are NOT
  341. CHECKED: if you have made significant changes to any of these buffers,
  342. the changes will be lost unless you save them before giving an exit
  343. command.
  344.  
  345. Partial list of system buffers:
  346.  
  347.     %bufflist%    the list of buffers is placed here (^X ^B)
  348.     %cal%        calendar output
  349.     %calc%        used for information transfer to/from the calculator
  350.     %dired%        the output of dired (^X ^D)
  351.     %help%        help command responses (^X H)
  352.     %kill%        the kill buffer: DON'T DELETE THIS!!!
  353.             (actually, you can't)
  354.     %scratch%    this buffer is created whenver you don't have
  355.             any non-system buffers
  356.  
  357.  
  358.  
  359. FILE LOADING
  360.  
  361. When Freyja loads a pre-defined file (e.g., "freyja.ini" or any of the
  362. "f*.doc" files), it looks in these places in this order:
  363.  
  364.     if present, the directory indicated by the "FREYJADIR"
  365.         environment variable
  366.     if present, the directory indicated by the "HOME"
  367.         environment variable
  368.     the search path ("PATH")
  369.     the current directory
  370.  
  371.  
  372.  
  373. INITIALIZATION FILE
  374.  
  375. Freyja's operation can be tailored in various ways.  These parameters
  376. are set in the "freyja.ini" file.  The specific parameters are
  377. documented in there.  For the most part, the only way to change a
  378. parameter is to change the file, then exit and restart Freyja.
  379.  
  380.  
  381.  
  382. COMMAND LINE OPTIONS
  383.  
  384. Freyja is started with the following command line:
  385.  
  386.     freyja [-options] [file(s)]
  387.  
  388. where the following options are supported:
  389.  
  390.     -z #    Sets the swap size to # Kbytes for this invocation only.
  391.  
  392.     -s X    Sets the screen type to X for this invocation only. 
  393.         See "freyja.ini" for legal values.
  394.  
  395. The upper/lower case of options is ignored.  Options can be given in
  396. any order and intermixed with file names.
  397.  
  398. "File(s)" is a list of zero or more file names.  Each one is read in
  399. with the equivalent of a ^X ^F command.  If none are supplied, you are
  400. left in the system buffer "%scratch%".
  401.  
  402.  
  403.  
  404. ALTERNATE KEYBOARD (MSDOS)
  405.  
  406. Freyja can be used with external keyboards in two different ways.
  407.  
  408. First, you can set Freyja to use a VT100 screen, set the keyboard to
  409. Console, and then use the MS/DOS CTTY command to change where your
  410. input is coming from.  This allows you to use Freyja from an external
  411. terminal (or computer running terminal emulator software).  The
  412. FREYJA.INI file would look like this:
  413.  
  414.     scr v
  415.     scs j    # HP95LX Jaguar only
  416.     key c
  417.  
  418. Second, you can set Freyja to use the computer's screen but fetch
  419. keyboard input from the serial port.  This would be useful if you have
  420. an external keyboard.  The FREYJA.INI file would look like this:
  421.  
  422.     scr m
  423.     scs j    # HP95LX Jaguar only
  424.     key s
  425.  
  426. In both cases you set the port to use, its speed, and its character
  427. format with the MS/DOS MODE command.  (I find that the HP95LX powers
  428. up in 9600 bps, 8 bits, no parity.)
  429.  
  430. Note that you cannot use the "special J" setting in FREYJA.INI, as
  431. this setting causes Freyja to override any screen or keyboard
  432. settings.
  433.  
  434.  
  435. USE WITH THE HP95LX (JAGUAR, MSDOS)
  436.  
  437. Special type 'J' is for the HP95LX.  If special type 'J' is used, the
  438. following changes are made to program Execution:
  439.  
  440. - The screen type is forced to memory-mapped.
  441. - Only a 16 x 40 screen is used.
  442. - HP-specific ROM BIOS calls are used for keyboard input.
  443. - If the PA1 P option is supplied in the FREYJA.INI file and the
  444. keyboard type is not C or S, the serial port is turned off during
  445. operation and on at exit.
  446. - Several function keys (the blue keys) > 132 are remapped.
  447. - The MENU key works.
  448. - The Blue keys cause Freyja to exit, then invoke the specified
  449. application.  (They push a space and the function key for the
  450. application onto the keyboard buffer.)
  451. - The cursor is set to a block cursor.
  452. - The SETUP number format is imported into the calculator.
  453. - The SETUP starting day-of-the-week is imported into the calendar.
  454. - The CHAR function keys work.
  455. - The search path for the help files automatically includes C:\_DAT. 
  456. It is not included for FREYJA.INI, as that file must be loaded before
  457. it can read the special handling parameter...
  458.  
  459.  
  460.  
  461. DIFFERENCES IN THE SYSTEM MANAGER COMPLIANT VERSION (JAGUAR, MSDOS)
  462.  
  463. - You can tell that you are running the system-manager compliant version
  464. because the menu has options for using the clipboard.
  465.  
  466. - The screen type is forced to memory-mapped.
  467. - Only a 16 x 40 screen is used.
  468. - Application manager calls are used for keyboard input.
  469. - Any SCR, SCS, KEY, SPE, and PA1 directives in "freyja.ini" are ignored.
  470. - The calculator is not present (the Turbo C floating point libraries
  471. use and interrupt in their interface; such use conflicts with sytem
  472. manage compliance guidelines)
  473. - The execute system command function is not present.
  474. - The SETUP starting day-of-the-week is imported into the calendar.
  475. - The serial port power is *not affected.*
  476. - The MENU key works.
  477. - The File menu is used.
  478. - The clipboard is accessible via the menu.
  479. - The cursor is set to a block cursor.
  480. - The CHAR function keys work.
  481. - The search path for FREYJA.INI and the help files is forced to
  482. be C:\_DAT and the current directory.
  483.  
  484.                >>> Important Note <<<
  485.  
  486. LOTUS grabs all available memory when it starts up.  Freyja needs
  487. memory for the swap space.  If you start Freyja, then LOTUS,
  488. everything works fine.  It doesn't work if you start LOTUS first.
  489.  
  490.  
  491.  
  492. FUTURE DIRECTIONS
  493.  
  494. It would be nice to see support for:
  495.  
  496. - Left margin support is really awful.  Since I never use it...
  497. - More than two windows.
  498. - Incremental search.
  499. - Support a kill ring.
  500. - Full DIRED.
  501. - Full buffer edit mode.
  502. - File name completion.
  503. - Set the current directory on a per-buffer basis.
  504. - Allow full editing on prompts.
  505. - Enhance the calculator to include, say, all features from the
  506. HP-16C, HP-19BII, HP-41CX, and HP-48SX.
  507. - .XIP (Jaguar-specific)
  508.